<template>
  <div id="app">
    <router-view class="main" />
    <van-tabbar
      v-model="active"
      v-show="isShow"
      active-color="rgb(219, 65, 65)"
    >
      <van-tabbar-item name="search" icon="home-o" :to="{ name: 'search' }"
        >首页</van-tabbar-item
      >
      <van-tabbar-item name="favorite" icon="tv-o" :to="{ name: 'mvList' }"
        >MV视频</van-tabbar-item
      >
      <van-tabbar-item name="user" icon="contact" :to="{ name: 'successLogin' }"
        >我的账户</van-tabbar-item
      >
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: "search",
      isShow: true,
    };
  },
  watch: {
    $route(v) {
      if (v.meta.hideTabBar) {
        this.isShow = false;
      } else {
        this.isShow = true;
      }
    },
  },
};
</script>
<style>
html,
body,
p,
h1,
h2,
h3,
h4,
h5,
h6,
input,
ul,
ol,
dl,
form,
textarea,
select,
th,
td {
  margin: 0;
  padding: 0;
}
html,
body,
#app {
  width: 100%;
  height: 100%;
}
#app {
  display: flex;
  flex-direction: column;
}
#app .main {
  flex: 1;
  overflow: auto;
}
#app .van-tabbar--fixed {
  position: static;
  box-shadow: 0 -1px rgba(139, 136, 136, 0.781);
}
</style>
